
from chernc.compiler.sfc.rust_sfc import RustCompilationContextSFC
from chernc.compiler.rust.error_messages import parse_error_messages
from chernc.compiler.rust.explain_error import explain_error
rust_sfc = RustCompilationContextSFC()
rust_sfc.write_code("""
fn main() {
    let a: int32 = 1;
    println("Hello, world!");
}
""")
compile_output = rust_sfc.compile()
errors = parse_error_messages(compile_output)
for error in errors:
    print(error)
    print("============")
run_output = rust_sfc.run()
print(run_output)
# rust_sfc.clean()

print(explain_error("E0308"))